<template>
  <el-card class="box-card" style="height: 100%;box-sizing: border-box">
    <MarkDown @on-save="submit">
      <template v-slot:title>
        <p style="color: #999;font-size: 14px">Ctrl+s保存</p>
      </template>
    </MarkDown>
    <div v-html="html"></div>
  </el-card>
</template>

<script>
import MarkDown from '../../../components/markdown/index'
export default {
  components: {
    MarkDown
  },
  data () {
    return {
      html: ''
    }
  },
  methods: {
    submit (e) {
      console.log('e:', e)
      if (e.value === '') {
        this.$notify.warning('内容为空，无法保存！')
      } else {
        this.$notify.success('保存成功！')
      }
    }
  }
}
</script>

<style lang="less" scoped>

</style>
